<%@ page contentType="text/html;charset=UTF-8" language="java" %>  
<%@include file="/common/jsp/common_header.jsp"%>
<html>
	<script>
        var body_width=150;
        var body_height=150;
    </script>
	<link href="<%=request.getContextPath()%>/ui/skin/donave/jscalendar/calendar-win2k-cold-1.css"
		rel="stylesheet" type="text/css" media="all">
	<script type="text/javascript"> 
	var validater;
	$().ready(function() {
			validater=$("#createFolder").validate({
				rules: {
					"columns.name": "required",
					"columns.sortCode": {
						number: true
					}
				}
			});
		});
    function dosave() {
    var needAjax='${needAjax}'
    if(needAjax){
    	if(!validater.form()){
    		return;
    	}
			$.ajax({
			    url: ctx+'/cms/cmsfold!saveFolderUseAjax.action',
			    type: 'POST',
			    dataType: 'text',
			    data:{
			    	'columns.parentId':$('#columnsParentId').val(),
			    	'columns.name':$('#columnsName').val(),
			    	'columns.sortCode':$('#columnsSortCode').val(),
			    	'columns.releaseMode':$('#columnsReleaseMode').val()
			    },
			    success: function(msg){
			    	  alert("添加成功！");
			    	  parent.closeit();
			     	  parent.parent.selectSubListTab();
			    }
			});
    }else{
      	   $("#createFolder").attr("action",ctx+"/cms/cmsfold!saveFolder.action");
           $("#createFolder").attr("target","_parent");
           $("#createFolder").submit();
    }
         
        
           
    }
 
    function doClose() {
        parent.closeit();
    }
</script>
	<link rel="stylesheet" href="/webwork/xhtml/styles.css" type="text/css" />
	<link rel="stylesheet" href="/webwork/jscalendar/calendar-blue.css"
		type="text/css" />
	<body scroll="no" >

		<div id="div_pagebody">
			<div id="body_inner">

				<s:form id="createFolder" name="createFolderForm"
					onsubmit="customOnsubmit_createFolder(); return true;"
					 method="post" theme="simple">
					<table class="wwFormTable">
						<table width="100%" height="10" border="0" cellpadding="0"
							cellspacing="0">
							<tr>
								<td></td>
							</tr>
						</table>
						<table align="center" width="100%" border="0" cellpadding="2"
							cellspacing="1" class="common_input_table">
							<tr>
								<td class="common_td_lable" width="30%" height="30">
									名称:
								</td>
								<td class="common_td_text_left" width="70%">
									<s:if test="columns.id != null">
										<s:hidden name="columns.id" />
									</s:if>
									<s:hidden id="refreshTree" name="refreshTree"></s:hidden>
									<s:hidden name="columns.parentId" id="columnsParentId"/>
									<s:textfield name="columns.name" id="columnsName" maxlength="50"/>
									<span class="interim">&nbsp;<font color="red">*</font>
									</span>
								</td>
							</tr>
							<tr>
								<td class="common_td_lable" height="30">
									排序号:
								</td>
								<td class="common_td_text_left">
									<s:textfield name="columns.sortCode"  id="columnsSortCode"  maxlength="5"/>
								</td>
							</tr>
							<tr>
								<td class="common_td_lable" height="30">
									信息发布方式:
								</td>
								<td class="common_td_text_left">
									<s:select name="columns.releaseMode" id="columnsReleaseMode" list="#{0:'直接发布'}"></s:select>
								</td>
							</tr>
						</table>
						</div>
						</div>
						<div id="div_footer">
							<table width='100%' border='0' cellspacing='0' cellpadding='0'>
								<tr>
									<td height='30'
										background='<%=request.getContextPath()%>/ui/skin/donave/images/sea_r29_c20.jpg'>
										&nbsp; &nbsp;
										<input type="button" id="doSave" class="button2" value="保存"
											onclick="dosave()" />
										&nbsp; &nbsp;
										<input type="reset" class="button2" value="重置" />
										&nbsp; &nbsp;
										<input type="button" class="button2" value="取消"
											onclick="doClose()" />
									</td>
								</tr>
							</table>
						</div>
						<s:token />
					</table>
				</s:form>
	</body>
</html>

